<?php
/**
 * 入口文件
 * Some rights reserved：www.jnbqs.com
 */
if (ini_get('magic_quotes_gpc')) {
	function stripslashesRecursive(array $array){
		foreach ($array as $k => $v) {
			if (is_string($v)){
				$array[$k] = stripslashes($v);
			} else if (is_array($v)){
				$array[$k] = stripslashesRecursive($v);
			}
		}
		return $array;
	}
	$_GET = stripslashesRecursive($_GET);
	$_POST = stripslashesRecursive($_POST);
}

// 开启调试模式
define("APP_DEBUG", true);

// 网站根路径
define('SITE_PATH', dirname(__FILE__) . "/");

// 项目路径
define('APP_PATH', SITE_PATH . 'application/');

// 缓存路径
define("RUNTIME_PATH", SITE_PATH . "data/runtime/");

// 静态缓存路径
define("HTML_PATH", SITE_PATH . "data/runtime/Html/");

// 版本号
define("XCMS_VERSION", 'V1.0.1');

define("XCMS_CORE_TAGLIBS", 'cx,Common\Taglib\TagLibCommon');

if(function_exists('saeAutoLoader') || isset($_SERVER['HTTP_BAE_ENV_APPID'])){
	// TODO
} else {
	if (!file_exists("data/install.lock")) {
		if (strtolower($_GET['g']) != "install") {
		    header("Location:./index.php?m=install");
		    exit();
		}
	}
}

// 载入框架核心文件
require SITE_PATH . 'ThinkPHP/ThinkPHP.php';
